#include<iostream>
#include<math.h>
#include<cstdio>
using namespace std;
double f(double x,int y){
	int h=y;
	double sum;
	if(h!=1){
		return sqrt(h+f(x,h-1));
	}
	else{
		return sqrt(1+x);
	}
} 
int main(){
	double x;
	int y;
	cin>>x>>y;
	printf("%.4f",f(x,y));
}
